﻿@{
    ViewBag.Title = "Pending Orders";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="box">
    <div class="box-header">
        <div class="title">Pending Orders</div>
    </div>
    <div class="box-content padded">
        @(Html.Kendo().Grid<Arms.Application.Modules.Orders.DTOs.OrderDTO>()
              .Name("PendingOrders")
              .Columns(c =>
              {
                  c.Bound(x => x.OrderID);
                  c.Bound(x => x.OrderHeaderID);
                  c.Bound(x => x.CustomerID);
                  //c.ForeignKey(x => x.OrderHeaderID, (System.Collections.IEnumerable)ViewData["OrderHeaders"], "OrderHeaderID", "OrderHeaderNumber").Title("Order Header Number");
                  //c.ForeignKey(x => x.CustomerID, (System.Collections.IEnumerable)ViewData["Customers"], "CustomerID", "SimpleContact").Title("Customer");
                  c.Bound(x => x.DiningRoomTableID);
                  c.Bound(x => x.OrderNumber);
                  c.Bound(x => x.SubTotal);
              })
              .DataSource(ds =>
              {
                  ds.Ajax()
                    .Model(model =>
                    {
                        model.Id(x => x.OrderID);
                        model.Field(x => x.OrderHeaderID).DefaultValue(0);
                        model.Field(x => x.CustomerID).DefaultValue(0);
                    })
                    .Read(r =>
                    {
                        r.Action("GetPendingOrders", "Order", new { area = "Orders" });
                    });
              })
              .Pageable()
)
    </div>
</div>

